package com.mars.admin.modules.user.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import jakarta.validation.constraints.Email;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Pattern;
import jakarta.validation.constraints.Size;
import java.time.LocalDate;

/**
 * 用户注册请求DTO
 *
 * @author Mars
 */
@Data
@Schema(description = "用户注册请求")
public class UserRegisterRequest {

    @Schema(description = "用户名", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "用户名不能为空")
    @Size(min = 3, max = 20, message = "用户名长度必须在3-20位之间")
    @Pattern(regexp = "^[a-zA-Z0-9_]+$", message = "用户名只能包含字母、数字和下划线")
    private String username;

    @Schema(description = "密码", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "密码不能为空")
    @Size(min = 6, max = 20, message = "密码长度必须在6-20位之间")
    private String password;

    @Schema(description = "昵称")
    @Size(max = 50, message = "昵称长度不能超过50位")
    private String nickname;

    @Schema(description = "真实姓名")
    @Size(max = 50, message = "真实姓名长度不能超过50位")
    private String realName;

    @Schema(description = "手机号")
    @Pattern(regexp = "^1[3-9]\\d{9}$", message = "手机号格式不正确")
    private String phone;

    @Schema(description = "邮箱")
    @Email(message = "邮箱格式不正确")
    private String email;

    @Schema(description = "头像URL")
    private String avatar;

    @Schema(description = "性别：0-未知，1-男，2-女")
    private Integer gender;

    @Schema(description = "生日")
    private LocalDate birthday;

    @Schema(description = "个性签名")
    @Size(max = 200, message = "个性签名长度不能超过200位")
    private String signature;

    @Schema(description = "所在地")
    @Size(max = 100, message = "所在地长度不能超过100位")
    private String location;

    @Schema(description = "微信OpenID")
    private String wechatOpenid;

    @Schema(description = "QQ OpenID")
    private String qqOpenid;

    @Schema(description = "注册类型：1-普通注册，2-微信注册，3-QQ注册")
    private Integer registerType;

    @Schema(description = "验证码")
    private String captcha;

    @Schema(description = "短信验证码")
    private String smsCode;
} 